﻿using System.Data;

namespace TfsReports.Web.Models
{
    /// <summary>
    /// Change
    /// </summary>
    public class Change
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="Change"/> class.
        /// </summary>
        /// <param name="dataRecord">The data record.</param>
        public Change(IDataRecord dataRecord)
        {
            ChangesetId = dataRecord.GetInt32(dataRecord.GetOrdinal("ChangesetId"));
            LinesAdded = dataRecord.GetInt32(dataRecord.GetOrdinal("LinesAdded"));
            LinesModified = dataRecord.GetInt32(dataRecord.GetOrdinal("LinesModified"));
            LinesDeleted = dataRecord.GetInt32(dataRecord.GetOrdinal("LinesDeleted"));
        }

        /// <summary>
        /// Gets or sets the churn id.
        /// </summary>
        /// <value>The churn id.</value>
        public int ChangesetId { get; set; }

        /// <summary>
        /// Gets or sets the lines added.
        /// </summary>
        /// <value>The lines added.</value>
        public int LinesAdded { get; set; }

        /// <summary>
        /// Gets or sets the lines modified.
        /// </summary>
        /// <value>The lines modified.</value>
        public int LinesModified { get; set; }

        /// <summary>
        /// Gets or sets the lines deleted.
        /// </summary>
        /// <value>The lines deleted.</value>
        public int LinesDeleted { get; set; }
    }
}
